import request from '@/utils/request'

export function getUserPref(module: string, key: string) {
  return request({ url: '/erp/pref', method: 'get', params: { module, key } })
}

export function saveUserPref(module: string, key: string, value: any) {
  return request({ url: '/erp/pref', method: 'post', params: { module, key }, data: typeof value === 'string' ? value : JSON.stringify(value), headers: { 'Content-Type': 'application/json' } })
}


